package Chapter6.namequeries;

import java.io.Serializable;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;

import org.hibernate.annotations.NamedQuery;

@Entity
@NamedQuery(name = "findBook", query = "from BookNameQueries where name = :name")
public class BookNameQueries implements Serializable {
	private static final long serialVersionUID = 1L;
	private Long id;
	private String name;
	private String address;

	public BookNameQueries() {
	}

	public BookNameQueries(String name, String address) {
		this.name = name;
		this.address = address;
	}

	@Id
	@GeneratedValue
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	@Override
	public String toString() {
		return this.id + "\t" + this.getName() + "\t" + this.getAddress();
	}
}
